package com.yeskery.nut.web.demo.feign;

import com.yeskery.nut.annotation.cloud.feign.FeignClient;
import com.yeskery.nut.annotation.web.GetMapping;
import com.yeskery.nut.annotation.web.PostMapping;
import com.yeskery.nut.annotation.web.RequestBody;
import com.yeskery.nut.annotation.web.RequestParam;
import com.yeskery.nut.core.InputStreamResource;
import com.yeskery.nut.core.MultipartFile;
import com.yeskery.nut.web.demo.common.R;

/**
 * @author YESKERY
 * 2024/1/23
 */
@FeignClient(name = "http", url = "http://localhost:8080")
public interface HttpFeignClient {

    @GetMapping("/version")
    R<String> version();

    @PostMapping("/upload/uploadTextByRequestBody")
    String uploadTextByRequestBody(@RequestBody InputStreamResource resource);

    @PostMapping("/upload/uploadTextByFromData")
    String uploadTextByFromData(@RequestParam("file") MultipartFile file);

    @PostMapping("/upload/uploadTextByMultiFromData")
    String uploadTextByMultiFromData(@RequestParam("file") MultipartFile file, @RequestParam("name") String name);

    @PostMapping("/upload/uploadTextByMaxFromData")
    String uploadTextByMaxFromData(@RequestParam("file1") MultipartFile file1, @RequestParam("name") String name,
                                   @RequestParam("file2") MultipartFile file2, @RequestParam("age") String age);
}
